package com.session01;

import java.util.Scanner;
import java.util.Random;

public class Demo4 {
    public static void main(String[] args) {
        Scanner num = new Scanner(System.in);
        int[] arr = new int[7];
        Random R = new Random();
        arr[0] = R.nextInt(33) + 1;
        //arr[0] = (int) (Math.random() * 33) + 1;   1-33的数
        //生成整型范围随机数a-b  (int)(Math.random()*(b-a+1)) + a
        int i = 1;
        while (i < 6) {
            int flag = 0;
            int temp = R.nextInt(33) + 1;
            for (int j = 0; j < i; j++) {
                if (arr[j] == temp) {
                    flag++;
                }
            }
            if (flag == 0) {
                arr[i] = temp;
                i++;
            }
        }

/*        int[] reds = new int[6];
        for (int i = 0; i < reds.length; i++) {
            reds[i] = (int) Math.random() * 33 + 1;
            for (int j = 0; j < i; j++) {
                if (reds[i] == reds[j]) {
                    i--;
                    break;
                }
            }
        }*/

        arr[6] = R.nextInt(16) + 1;
        for (int element : arr) {
            System.out.print(element + " ");
        }
    }
}
